{% extends 'base.html' %}
{% block  contents %}
     <span style="border: red">用户信息</span>
    <p>当前用户人数：{{ users|length }} 人 </p>
    <table border="1" align="left" >
       {% for user in users %}
           <tr>
              <td>{{ loop.index }}</td>
              <td>{{ user.username }}</td>
              <td>{{ user.password }}</td>
              <td>{{ user.phone }}</td>
               <td> <a href="javascript:;" onclick="update('{{ user.username }}')">修改</a>
                   <a href="javascript:;" onclick="del('{{ user.username}}')">删除</a> </td>
           </tr>
       {% endfor %}
    </table>
{% endblock %}

{% block myjs %}
    <script>
       function del(username) {
        console.log(username)
           location.href='/del?username='+username
       }
       function update(username) {
         console.log('update users :'+username)
           location.href = '/update?username='+username
       }
    </script>
{% endblock %}